'use strict'
class upload {
    constructor () {

    }
    async post(c){
        console.log('----------------------------------------------------------------')
        console.log('c.body：',c.body)
        console.log('----------------------------------------------------------------')
        console.log('c.body.toString()：',c.body.toString())
        // 保存图片文件
        let f = c.getFile('image');
        let fname = c.helper.makeName(f.filename);
        let filePath = `/home/imgs/${fname}`;
        await c.moveFile(f,filePath);
        c.send(fname)
    }
}
module.exports = upload;